import 'package:boss/models/store_table.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/shadow_radius_card.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class TableManagementTableItem extends StatelessWidget {
  final StoreTable data;
  final VoidCallback onTap;

  const TableManagementTableItem({
    Key key,
    @required this.data,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      behavior: HitTestBehavior.translucent,
      child: ShadowRadiusCard(
        padding: EdgeInsets.symmetric(
          horizontal: 10.w,
        ),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            Text(
              data.tableName,
              style: TextStyleConstant().normal_1_36,
              overflow: TextOverflow.ellipsis,
            ),
            RichText(
              text: TextSpan(text: '${data.maxPerson}', style: TextStyleConstant().normal_2_36, children: [
                TextSpan(
                  text: ' 人',
                  style: TextStyleConstant().normal_3_22,
                ),
              ]),
            ),
          ],
        ),
      ),
    );
  }
}
